from level_one import MainGame_one
from level_two import MainGame_two
from level_three import MainGame_three
from level_four import MainGame_four
from level_five import MainGame_five
from Start import StartMenu
from EndScreen import EndScreen

if __name__ == "__main__":

    while True:  # 添加主循环
        # 显示开始菜单
        menu = StartMenu()
        menu_result = menu.run()
        print("用户选择了：", menu_result)
        if menu_result != "game":
            break
        # 运行所有关卡
        MainGame_one().StartGame()
        MainGame_two().StartGame()
        MainGame_three().StartGame()
        MainGame_four().StartGame()
        MainGame_five().StartGame()

        # 显示通关界面
        end_screen = EndScreen()
        end_action = end_screen.run()

        if end_action != "restart":
            break  # 退出循环